<html>
<head>
<title>This tests XMLSerializer.serializeToString() on a newly created DocumentType node does not throw since the node has an associated document</title>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
</head>
<body>
<script>
setup({single_test: true});

var docType = window.document.implementation.createDocumentType("aDocTypeName", "aPublicID", "aSystemID");
var serializer = new XMLSerializer();

var text;
try {
  text = serializer.serializeToString(docType);
} catch (e) {
  assert_unreached('Should not throw exception');
}
assert_equals(text, "<!DOCTYPE aDocTypeName PUBLIC \"aPublicID\" \"aSystemID\">");
done();
</script>
</body>
</html>
